﻿Imports Microforma.BEL
Imports Microforma.BLL

Public Class frmAddListClients

    Private _bolUpdate As Boolean
    Public Property bolUpdate() As Boolean
        Get
            Return _bolUpdate
        End Get
        Set(ByVal value As Boolean)
            _bolUpdate = value
        End Set
    End Property


    Private _IdCliente As Integer
    Public Property pIdCliente() As Integer
        Get
            Return _IdCliente
        End Get
        Set(ByVal value As Integer)
            _IdCliente = value
        End Set
    End Property


    Private _Nombre As String
    Public Property pNombre() As String
        Get
            Return _Nombre
        End Get
        Set(ByVal value As String)
            _Nombre = value
        End Set
    End Property


    Private _IdTipo As Integer
    Public Property IdTipo() As Integer
        Get
            Return _IdTipo
        End Get
        Set(ByVal value As Integer)
            _IdTipo = value
        End Set
    End Property


    Private _IdUsuario As Integer
    Public Property IdUsuario() As Integer
        Get
            Return _IdUsuario
        End Get
        Set(ByVal value As Integer)
            _IdUsuario = value
        End Set
    End Property


    Private _Fecha As String
    Public Property Fecha() As String
        Get
            Return _Fecha
        End Get
        Set(ByVal value As String)
            _Fecha = value
        End Set
    End Property

    Public strListVariables As String
    Public strListIndices As String
    Dim flag As Boolean

    Sub New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        ' Add any initialization after the InitializeComponent() call.
    End Sub



    Private Sub frmAddListVariables_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim _ClienteBL As New ClienteBL
        Dim table As DataTable = _ClienteBL.List

        LoadList(table)

    End Sub

    Private Sub btnCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelar.Click
        strListVariables = ""
        Me.Close()
    End Sub

    Private Sub LoadList(ByVal _table As DataTable)
        lstListVar.ValueMember = "IdCliente"
        lstListVar.DisplayMember = "Nombre"
        lstListVar.DataSource = _table
    End Sub

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        If lstListVar.SelectedItems.Count > 0 Then

            pIdCliente = lstListVar.SelectedValue
            pNombre = lstListVar.Text

            Me.Close()
        Else
            Me.Close()
        End If
    End Sub

End Class